package com.bzchao.github;

import com.bzchao.github.common.DemoService;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

@Slf4j
@SpringBootApplication
public class DubboZKConsumerBootstrap {
    @Reference(version = "1.0.0")
    private DemoService demoService;

    public static void main(String[] args) {
        SpringApplication.run(DubboZKConsumerBootstrap.class, args);
    }

    @Bean
    public ApplicationRunner runner() {
        return args -> {
            String mercyblitz = demoService.sayHello("mercyblitz");
            log.info("传回消息：{}", mercyblitz);
            log.info(mercyblitz);
        };
    }
}